package org.zhs.springframework.factory.support;

import org.zhs.springframework.BeansException;
import org.zhs.springframework.core.io.Resource;
import org.zhs.springframework.core.io.ResourceLoader;
import org.zhs.springframework.factory.config.BeanDefinition;

/**
 * Bean 定义注册接口
 */
public interface BeanDefinitionReader {

    /**
     * 获取一个BeanDefinitionRegistry
     * @return
     */
    BeanDefinitionRegistry getRegistry();

    /**
     * 获取一个资源加载器
     * @return
     */
    ResourceLoader getResourceloader();

    /**
     * 根据resource加载beanDefinitions
     * @param resource
     */
    void loadBeanDefinitions(Resource resource) throws BeansException;

    void loadBeanDefinitions(Resource... resources) throws BeansException;

    void loadBeanDefinitions(String location) throws BeansException;

}
